home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
compuserve-file-archive
/
05 Programming
/
CDT128.ARC
/
DUMP.C
< prev
next >
Wrap
Text File
|
2019-04-13
|
2KB
|
79 lines
/***********************************************************************/
/***********************************************************************/
/* */
/* ╘HIS PROGRAM IS COPYRIGHT 1986 BY ┴LAN ┘ORINKS. ╔T MAY BE FREELY */
/* DISTRIBUTED FOR NON COMMERCIAL USAGE IF THIS COPYRIGHT NOTICE IS */
/* LEFT INTACT. ├OMMERCIAL USAGE OF THIS PROGRAM IS EXPLICITLY */
/* FORBIDDEN WITHOUT THE WRITTEN PERMISSION OF THE AUTHOR. */
/* */
/***********************************************************************/
/***********************************************************************/
/* CDT VERSION 1.0 PART 9 OF 15 ╩ULY 25, 1986 */
/* MEMORY DUMP FUNCTION */
#INCLUDE <STDIO.H>
#INCLUDE "DBUG.H"
#IFDEF ├╧╠80 /* DEFINE THE NUMBER OF BYTES TO PRINT PER LINE */
#DEFINE ┬├╧╒╬╘ 16
#ELSE
#DEFINE ┬├╧╒╬╘ 8
#ENDIF
VOID
DUMP()
█
AUTO CHAR *I ; /* MUST BE AUTO - PASSED AS FUNC ARG */
AUTO INT LNCNT = 0 ; /* PRINTED LINE COUNTER-AUTO BECAUSE IT WORKS */
INT C ; /* RECIPIENT OF GETCHAR */
╒╔╬╘ BYTE ; /* BYTE TO BE PRINTED */
EXTERN ┴╥╟╙ ALLARG ; /* ARGUMENT UNION */
EXTERN INT PAGE ; /* PAGE FLAG */
EXTERN ╒╔╬╘ HATOI() ; /* HEX TO ASCII CONVERSION FUNCTION */
EXTERN VOID PAGER() ; /* PAGINATE FUNCTION */
FOR( ; ╙┴──╥(DSDMP) < ┼┴──╥(DSDMP); ╙┴──╥(DSDMP) += ┬├╧╒╬╘ )
█
/* PRINTF FIRST ADDRESS OF PRINT LINE */
PRINTF("\N%04X: ",╙┴──╥(DSDMP)) ;
/* PRINT LINE OF HEX VALUES */
FOR( I = ╙┴──╥(DSDMP) ; I < ╙┴──╥(DSDMP) + ┬├╧╒╬╘ ; I++)
#IFDEF ├64
PRINTF("%02X ", ╨┼┼╦( I ) );
#ELSE
PRINTF("%02X ", PEEK(┬┴╬╦(DSDMP), (UNSIGNED) I)) ;
#ENDIF
/* CONTINUE LINE WITH ASCII VALUES */
FOR( I = ╙┴──╥(DSDMP) ; I < ╙┴──╥(DSDMP) + ┬├╧╒╬╘ ; I++)
█
#IFDEF ├64
IF( ISPRINT( BYTE = ╨┼┼╦( I ) ) )
#ELSE
IF( ISPRINT( BYTE = PEEK(┬┴╬╦(DSDMP), (UNSIGNED) I) ) )
#ENDIF
PRINTF("%C",BYTE) ;
ELSE
PRINTF(".") ;
▌
/* PAGEING NECESSARY ? */
IF( PAGE == ╘╥╒┼ )
PAGER() ;
▌
▌